<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        //组合继承  原型继承+构造器继承(继承方法与属性)

         function People(name, age) {
            this.name = name;
            this.age = age;
        }
        People.prototype.behavior = function (){
            console.log("吃喝拉撒")
        }
        function Students(name, age, school, grade, theClass) {
            //借用构造函数
            People.call(this, name, age);
            this.school = school;
            this.grade = grade;
            this.theClass = theClass;
        }
        Students.prototype = People.prototype;
        //    Students.prototype = new People();
        var students = new Students("wx",18,"某某高中", "高一", "三班");
        console.dir(students);
        students.behavior();
    </script>
</body>
</html>